home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DATA / DATA_FOR / 1073B.ZIP / DISPLAY.ARC / STD.H < prev   
Text File  |  1984-11-10  |  2KB  |  84 lines

  1. /*
  2. **  STD.H
  3. **
  4. **  Standard Utility Header for C Programs
  5. */
  6.  
  7. /* Conventions */
  8.  
  9. #define NULL     0
  10. #define NIL      0
  11. #define YES      1
  12. #define NO       0
  13. #define TRUE     1
  14. #define FALSE    0
  15. #define UNKNOWN -1
  16. #define ABSENT  -7777777
  17.  
  18. /* Pseudo Types */
  19.  
  20. /* 8 bits = 2 nibbles = 1 byte = 1 character */
  21. typedef char BOOLEAN;
  22. typedef char CHARACTER;
  23. typedef char *STRING;
  24. typedef char BYTE;
  25. typedef char *POINTER;
  26.  
  27. /* 16 bits = 4 nibbles = 2 bytes = 2 characters = 1 word */
  28. typedef int VOID;
  29. typedef int INTEGER;
  30. typedef unsigned NOMINAL;
  31. typedef unsigned COUNT;
  32. typedef unsigned WORD;
  33. typedef unsigned ADDRESS;
  34. typedef unsigned BITS;
  35. typedef unsigned FLAGS;
  36.  
  37. /* 32 bits = 8 nibbles = 4 bytes = 4 characters = 2 words = 1 longword */
  38. typedef long int LONG;
  39.  
  40. /* 32 bits = 4 bytes = 1 single precision float */
  41. typedef float FLOAT;
  42.  
  43. /* 64 bits = 8 bytes = 1 double precision float */
  44. typedef double DOUBLE;
  45.  
  46. /* Function Handles */
  47. typedef (FUNCTION)();
  48. typedef (*FUNCTION_LIST)();
  49.  
  50. /* Compound Data Types */
  51.  
  52. typedef union {
  53.         BYTE         _byte;
  54.         WORD         _word;
  55.         INTEGER      _integer;
  56.         POINTER      _pointer;
  57.         STRING       _string;
  58.         LONG         _long;
  59. } GENERIC_STRUCT, *GENERIC;        
  60.  
  61. typedef union {
  62.             unsigned _memlongword;
  63.             struct {
  64.                     short unsigned _low;
  65.                     short unsigned _high;
  66.             } _memword;
  67.             struct {
  68.                     char _one;
  69.                     char _two;
  70.                     char _three;
  71.                     char _four;
  72.             } _membyte;
  73. } *MEMORY;
  74.  
  75. /* Storage Classes */
  76.  
  77. #define FAST   register
  78. #define LOCAL  static
  79. #define GLOBAL extern
  80.  
  81. /* Macros */
  82.  
  83. #define FOREVER        for(;;)
  84.